﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeCommentAnalyser
{
    /// <summary>
    /// 
    /// </summary>
    public partial class CommentsDetail : Form
    {
        /// <summary>
        /// List of Projects with counter
        /// </summary>
        public  List<CommentCount> ListProjComments;
        public CommentsDetail()
        {
            InitializeComponent();
            
            
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnActivated(EventArgs e)
        {
            base.OnActivated(e);
            
        }
        /// <summary>
        /// show refresh
        /// </summary>
        public void ShowGrid()
        {
            try
            {
                dgrListComments.DataSource = ListProjComments;
                dgrListComments.Refresh();
                Show(); 
                MessageBox.Show("Grid count is : " + ListProjComments.Count);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry Error : " + ex.ToString ()); 
            }

        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            ShowGrid();
        }

        private void CommentsDetail_Load(object sender, EventArgs e)
        {
            dgrListComments.AutoGenerateColumns = true; 
        }
    }
}
